<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="${path}/res/app/css/index.css">
<script type="text/javascript" src="${path}/cms/js/jquery-1.8.3.min.js"></script>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>农产品质量安全追溯系统</title>
</head>
<body>
<div class="topBox">
    <div class="topBoxCon">
        <input type="text" id="parkName" placeholder="请输入园区名称...">
        <input type="text" id="blockName" placeholder="请输入地块名称...">
        <button type="button" id="querybtn" onclick="doquery()">搜索</button>
    </div>
</div>
<ul class="listBox" id="plantList">
  
</ul>
<script type="text/javascript">
$(function(){
	doquery();
});
function doquery(){
	$('#querybtn').prop("disabled", true);
	var plantList = $('#plantList');
	var parkNameSearch = $('#parkName').val();
	var blockNameSearch = $('#blockName').val();
	plantList.empty();
	$.get('${path}/api/app/getPlantList.json?ssid=${ssid}&type=${type}&page=1&pageNum=100&parkNameSearch='+ parkNameSearch +'&blockNameSearch='+blockNameSearch, function(list){
		$.each(list, function(i, d){
			var parkName = d.parkName;
			var blockName = d.blockName;
			var cropName = d.cropName;
			var beginTime = d.beginTime;
			plantList.append('<li class="plantListLi" onclick="jump(\''+d.id+'\');"><div><span>'+ cropName +'</span></div><div> <p>' + parkName + '</p> <p>' + blockName + '</p></div> <div>' + beginTime + '</div> </li>');
		});
		$('#querybtn').prop("disabled", false);
	});
}
function jump(id){
	window.open("${path}/api/app/plantDetail.do?id="+id,"_blank");
}
</script>
</body>
</html>